﻿namespace AnyOffice.Components
{
    using System;
    using System.Collections;
    using System.Globalization;

    internal class myCultureComparer : IEqualityComparer
    {
        public CaseInsensitiveComparer myComparer;

        public myCultureComparer()
        {
            this.myComparer = CaseInsensitiveComparer.DefaultInvariant;
        }

        public myCultureComparer(CultureInfo myCulture)
        {
            this.myComparer = new CaseInsensitiveComparer(myCulture);
        }

        public bool Equals(object x, object y)
        {
            return (this.myComparer.Compare(x, y) == 0);
        }

        public int GetHashCode(object obj)
        {
            return obj.ToString().ToLower().GetHashCode();
        }
    }
}

